﻿
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
    <meta charset="UTF-8">
    <title>绩效标准</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link href="~/X-admin/css/font.css" rel="stylesheet" />
    <script src="~/X-admin/lib/layui/layui.all.js"></script>
    <link href="~/X-admin/css/xadmin.css" rel="stylesheet" />
    <script src="~/X-admin/js/jquery.min.js"></script>
    <script src="~/X-admin/js/xadmin.js"></script>
    <script src="~/js/framework/sysframework.js"></script>
    <script src="~/js/framework/commonjs.js"></script>
</head>
<body>
 <ul lay-bar="disabled" class="mWebBanner">
        <li class="layui-nav-item" style="float:left;">
            <button id="btn-update" type="button" name="btn_update" onclick="loadData()" class="buttonCss">
                <i class="layui-icon" style="margin-right:3px">&#xe615</i>查 询
            </button>
        </li>
        <li class="layui-nav-item" style="float:left;margin-left:3%">
            <button id="btn-update" type="button" name="btn_update" onclick="Confirm()" class="buttonCss">
                <i class="layui-icon" style="margin-right:3px">&#x1005;</i>确认选择
            </button>
        </li>

        <li class="layui-nav-item" style="float:left;margin-left:3%">
            <button id="btn-sync" type="button" onclick="closeWin()" class="buttonCss">
                <i class="layui-icon" style="margin-right:3px">&#x1007;</i>关闭页面
            </button>
        </li>
    </ul>
    <div class="layui-fluid">
     
        <div class="layui-row layui-col-space15">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <div class="layui-card-body ">
                        <form class="layui-form layui-col-space5" name="qForm" id="qForm">
                            <div class="layui-inline layui-show-xs-block">
                                <input type="text" name="versionCode" placeholder="工艺版本" class="layui-input" id="versionCode">
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <input type="text" name="relationCode" placeholder="关联编码" class="layui-input" id="relationCode">
                            </div>
                            <div class="layui-inline layui-show-xs-block">
                                <input type="text" name="relationName" placeholder="关联名称" class="layui-input" id="relationName" style="width:170%">
                            </div>
                       


                        </form>
                    </div>
                    <div class="layui-card-body layui-table-body layui-table-main">
                        <table class="layui-hide" id="list" lay-filter="list"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>

</html>

<script>
    var currPage = 1;//首先默认值为1，防止出错
    var dUrl = "../ProductSet/getDataList?dataType=gsp&condition=";
    var cData = undefined;
    /**
    数据加载
    **/
    function loadData() {
        layui.use('table', function () {
            var conditon = JSON.stringify(FormToJson("qForm"));
            var table = layui.table;
            table.render({
                elem: '#list'
                , cols: [[ //标题栏
                      { type: 'checkbox' }
                    , { field: 'keyCode', title: '工艺编码', width: 150 }
                    , { field: 'gyName', title: '工艺名称', width: 180 }
                    , { field: 'relationName', title: '关联数据', width: 250 }
                    , { field: 'versionCode', title: '工艺版本', width: 100 }
                    , { field: 'memo', title: '备注说明', width: 130 }
                   
                ]], done: function (res, curr, count) {
                    currPage = curr;
             
                }
                , url: dUrl + conditon
                , skin: 'row' //表格风格
                , even: true
                , page: true //是否显示分页
                , limits: [15, 20, 30]
                , limit: 15 //每页默认显示的数量
            });
            //监听工具条
            table.on('checkbox(list)', function (obj) {
                var checkStatus = table.checkStatus('list');
                var select = new Array();
                for (var i = 0; i < checkStatus.data.length; i++) {
                    select.push(checkStatus.data[i]);
                }
                cData = select;
            });

        });
    }
 
    $(function () {
        $("input[ name='relationCode']").val(getUrlVariable("proCode"));
        $("input[ name='relationName']").val(getUrlVariable("proName"));
        loadData();
        $(document).keyup(function (event) {
            if (event.keyCode == 13) {
                loadData();
            }
        })
    })

    function Confirm() {
        if (cData.length < 1) {
            layer.msg("您没有选择任何数据"); return;
        } else {
            if (cData.length > 1) {
                layer.msg("请选择一条数据"); return;
            } else {
                parent.ChanageGYPar(cData); //这是父页面函数
                var index = parent.layer.getFrameIndex(window.name);
                parent.layer.close(index);
            }
        }
    }
</script>